package com.example.ioc;

import com.example.ioc.dao.UserDao;
import com.example.ioc.factory.BeanFactory;
import com.example.ioc.service.UserService;


public class Main {

    public static void main(String[] args) {
        UserService userService= (UserService) BeanFactory.getBean("userService");
        userService.setDao((UserDao) BeanFactory.getBean("userDao"));
        int age = userService.calculate(17);
        System.out.println(age);
    }
}
